#include<stdio.h>

int main()
{
	int n,m,flag=1,s1=0,s2=0,sum1=0,sum2=0;
	scanf("%d %d",&m,&n);
	int max=m>n?m:n;
	for(;flag<=max/2.0;flag++){
		if(m%flag==0){
			sum1+=flag;
			s1++;
		}
		if(n%flag==0){
			sum2+=flag;
			s2++;
		}
	}
	if(sum1==n&&sum2==m) printf("yes ");
	else printf("no ");
	printf("%d %d",s1,s2);
	return 0;
}
